package com.vcredit.creditcat.vo;

import java.util.ArrayList;
import java.util.List;

import com.vcredit.creditcat.enumtype.MessageOperationEnum;
import com.vcredit.creditcat.util.EnumExtUtil;

/**
 * 
 * 设置消息状态 - 入参参数
 * 
 * @author wuqi01
 *
 */
public class MessageOperationVo {
	private String msgIds;// 消息编号，可批量设置“,”分隔
	private int msgKind;//消息类型（3:我的消息 4:首页消息）
	private Integer operationKind;// 操作类型(1、设置消息已读 2、删除消息)

	public String getMsgIds() {
		return msgIds;
	}

	public void setMsgIds(String msgIds) {
		this.msgIds = msgIds;
	}

	public int getMsgKind() {
		return msgKind;
	}

	public void setMsgKind(int msgKind) {
		this.msgKind = msgKind;
	}

	public MessageOperationEnum getMsgOperationEnum() {
		MessageOperationEnum enumOnValue = null;
		try {
			enumOnValue = EnumExtUtil.getEnumOnValue(MessageOperationEnum.class, String.valueOf(operationKind), "code");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return enumOnValue;
	}

	public Integer getOperationKind() {
		return operationKind;
	}

	public void setOperationKind(Integer operationKind) {
		this.operationKind = operationKind;
	}

	public List<Long> cMsgIds() {
		// 处理msgIds字符串
		String[] arr = getMsgIds().split(",");
		List<Long> ids = new ArrayList<Long>();
		for (String s : arr) {
			ids.add(Long.valueOf(s));
		}
		return ids;
	}
}
